Increasing of word demand load caused a new Distributed Generation (DG) to enter to power system. One of the most renewable energy is the Photovoltaic System. It is beneficial to use this system in both separately as well as connected to power system using power electronics interface. In this paper an optimal PID controller for Photovoltaic System systems has been developed. The optimization technique is applied to PID optimal controller in order to control the voltage of Photovoltaic System against load variation, is presents. Nonlinear characteristics of load variations as plant input, Photovoltaic System operational behavior demand for high quality optimal controller to ensure both stability and safe performance. Thus, Honey Bee Mating Optimization (HBMO) is used for optimal tuning of PID coefficients in order to enhance closed loop system performance. In order to use this algorithm, at first, problem is written as an optimization problem which includes the objective function and constraints, and then to achieve the most desirable controller, HBMO algorithm is applied to solve the problem. In this study, the proposed controller is applied to the closed loop photovoltaic system behavior. Simulation results are done for various loads in time domain, and the results show the efficiency of the proposed controller in contrast to the previous controllers.